package com.lagou.sample;

import com.lagou.ipersistence.io.Resources;
import com.lagou.ipersistence.session.SqlSession;
import com.lagou.ipersistence.session.SqlSessionFactory;
import com.lagou.ipersistence.session.SqlSessionFactoryBuilder;
import com.lagou.sample.entity.Product;
import com.lagou.sample.entity.User;
import com.lagou.sample.mapper.UserMapper;

import java.io.InputStream;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Map;

/**
 * @author Yan Jiahong
 * Created 2020/11/8
 */
public class Test {
    public static void main(String[] args) throws Exception {
//        InputStream in = Resources.getResourceAsStream("sqlMapConfig.xml");
//        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(in);
//        SqlSession session = sqlSessionFactory.openSession();
//        User dto = new User();
//        dto.setId(3L);
//        User user = session.selectOne("user.selectOneById", dtp);
//        System.out.println(user);
//
//        List<User> users = session.selectList("user.selectList");
//        for (User retUser : users) {
//            System.out.println(retUser);
//        }
//        UserMapper userMapper = session.getMapper(UserMapper.class);
//        User user = userMapper.selectOneById(dto);
//        System.out.println(user);

//        List<User> users = userMapper.selectList();
//        for (User retUser : users) {
//            System.out.println(retUser);
//        }

        Method method = Product.class.getDeclaredMethod("getOrders");
        Type type = method.getGenericReturnType();
        System.out.println(type);
    }
}
